package com.cetccloud.ap.controller;

import com.cetccloud.ap.common.RuntimeCache;
import com.cetccloud.ap.controller.model.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * @ClassName RuntimeController
 * @Description TODO
 * @Author superz
 * @Date 2021/4/25 15:56
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping("/runtime")
public class RuntimeController {

    @Autowired
    private RuntimeCache runtimeCache;

    @GetMapping("/s10/token")
    public Mono<ApiResult> s10Token(@RequestParam("token") String token) {
        log.info("/runtime/s10/token: {}", token);
        runtimeCache.setS10Token(token);
        return Mono.just(ApiResult.success());
    }
}
